<template>
    <vue-office-excel :src="'/api/file/getFile/' + fileId" @rendered="renderedHandler" @error="errorHandler" style="height: 90vh;"/>
</template>

<script>
//引入VueOfficeExcel组件
import VueOfficeExcel from '@vue-office/excel'
//引入相关样式
import '@vue-office/excel/lib/index.css'

export default {
    name: "preview-excel",
    props: ['fileId'],
    components: {
        VueOfficeExcel
    },
    methods: {
        renderedHandler() {
            console.log("渲染完成")
        },
        errorHandler() {
            console.log("渲染失败")
        }
    }
}
</script>